home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / BARNET / FREENET / CROFT / GROUPS02 / !DBAssist2 / !Help < prev    next >
Text File  |  1994-08-21  |  4KB  |  134 lines

  1.  
  2.       DBAssist2 - a programmers' desktop debugging assistant
  3.       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4.  
  5. Copyright notice
  6. ================
  7.  
  8. This 100%, hand-crafted, ARM code application is Copyright, 1994, the author
  9. Richard Sargeant. You may NOT include this program or any part thereof in
  10. any commercial software without my prior written permission.
  11.  
  12.  
  13. Introduction
  14. ============
  15.  
  16. Conceptual details from !DBAssist
  17. ---------------------------------
  18.  
  19. DBAssist is a small utility program to aid debugging desktop programs.
  20.  
  21. Instead of having to use Wimp_ReportError to display variables etc. whilst
  22. debugging, or writing them to a file which possibly could be corrupted if the
  23. software crashes the machine, it should send a wimp message to DBAssist,
  24. which will then display the line in a window and optionally write it to a
  25. file also.
  26.  
  27.  
  28. Note from Author of !DBAssist2
  29. ------------------------------
  30.  
  31. DBAssist2 is a even *smaller* utility program to aid debugging desktop
  32. programs. Uses 32K versus 96K on my Acorn A5000, or 12K versus 76K when in
  33. use on a Risc PC. :-)
  34.  
  35.  
  36. Arc-Binkley compatible
  37. ----------------------
  38.  
  39. Versions 2.19 (and later..?) of this program support redirection of the
  40. low-level debugging output to !DBAssist (V1.02). Not surprisingly both these
  41. programs are maintained by Keith Hall.
  42.  
  43. !DBAssist2, by Richard Sargeant also supports the same protocol. The display
  44. window records the 64 most recent lines of the debugging output. The window
  45. automatically scrolls, just as !DBAssist and !Binkley do.
  46.  
  47. It can also record the output to a file, the name of which defaults to
  48. <DBAssist2$Dir>.LogFile, but this can be by-passed by specifying a different
  49. filename as parameters to the last command in the !Run file which invokes
  50. !DBAssist2. Depending on whether the word -log is on this line, the writing
  51. of the debugging data to file may commence as soon as the application is
  52. started. Still only needs 12K, when last checked.
  53.  
  54.  
  55. Style of log output
  56. -------------------
  57.  
  58. The program shows today's date on start-up, and shutdown (if you watch
  59. carefully). The log output includes the time down the left hand side. When
  60. the application receives debugging information from a different application
  61. task, then it's name is recorded. If for some reason the name can not be
  62. found for some reason, like:
  63.  
  64. a) The Task Manager module has died or has been re-initialised, and
  65. therefore is unaware of the names of tasks already running, or...
  66.  
  67. b) This program is being run on a RISC OS 2 machine, then...
  68.  
  69. The task's handle is shown, in hexadecimal, as an compromise.
  70.  
  71. Multiple copies of applications running and sending debugging messages are
  72. detected, even if the task-names are identical.
  73.  
  74.  
  75. Automatic dbassist logging info from !DBAssist V1.02
  76. -----------------------------------------------------
  77.  
  78. The message is #&82782 (as above, but the first word of the data in the
  79. message being the 'action' code). Codes are:
  80.  
  81. &827820 - enquire and force DBAssist to respond if present
  82. &827821 - sent by DBAssist when starting and after receiving &827820
  83. &827822 - sent by DBAssist when shutting down.
  84.  
  85.  
  86. How to make use of it!
  87. ======================
  88.  
  89. Use from a WIMP application, written in BASIC
  90. ---------------------------------------------
  91.  
  92. DIM mb% 256:REM block to hold debugging information temporaily
  93. :
  94. PROCtrace("Information!")
  95. :
  96. REM tracing procedure
  97. DEF PROCtrace(A$)
  98. !mb%=(25+LEN(A$)) AND-4:mb%!12=0
  99. mb%!16=&82782:$(mb%+20)=A$+CHR$0
  100. SYS"Wimp_SendMessage",17,mb%,0
  101. ENDPROC
  102.  
  103.  
  104. Use from a WIMP application, written with DeskLib
  105. -------------------------------------------------
  106.  
  107. extern void trace(char *);
  108. extern void tracef(char *, ...);
  109.  
  110. /* 
  111.  * these functions have been pre-compiled, and are to be found
  112.  * in the file dba-object - just copy over as o.dba and add this
  113.  * to the list of files you include at link time
  114.  */
  115.  
  116. perform_test(void)
  117. {
  118.   trace ("This is a test of tracing");
  119.   tracef("Testing, %s, %d, %d, %d", "testing", 1, 2, 3);
  120. }
  121.  
  122.  
  123.  
  124.  
  125. ---------------------------------------------------------------------------
  126.  
  127. Richard Sargeant - e-mail Sargeant@arcade.demon.co.uk
  128.                    netmail Fidonet #2:257/609.8
  129.  
  130. Or "Ricky Sarge"   at Arcade BBS, user number 879,
  131.                    Digital Databank, user number 402.
  132.  
  133. ---------------------------------------------------------------------------
  134.